import Request from '@/utils/request/request-util';

/**
 * 收藏网站api
 *
 * @author fengshuonan
 * @date 2024/3/21
 */
export class BookmarksApi {
  /**
   * 获取收藏列表
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static getBookmarksPage(params) {
    return Request.getAndLoadData('/bookmarks/page', params);
  }

  /**
   * 添加收藏
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static addBookmark(params) {
    return Request.post('/bookmarks/add', params);
  }

  /**
   * 删除收藏
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static deleteBookmark(params) {
    return Request.post('/bookmarks/delete', params);
  }

  /**
   * 更新收藏
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static updateBookmark(params) {
    return Request.post('/bookmarks/edit', params);
  }

  /**
   * 获取收藏详情
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static getBookmarkDetail(params) {
    return Request.getAndLoadData('/bookmarks/detail', params);
  }

  /**
   * 更新点击次数
   *
   * @author fengshuonan
   * @date 2024/3/21
   */
  static updateClickCount(params) {
    return Request.post('/bookmarks/click', params);
  }

  /**
   * 更新书签置顶状态
   *
   * @author xixiaowei
   * @date 2024/03/21 10:30:00
   */
  static pinned(params) {
    return Request.post('/bookmarks/pinned', params);
  }
}